package com.corpgovernment.organization.vo.budget;

import lombok.Getter;
import lombok.Setter;

import javax.validation.Valid;
import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.List;

@Getter
@Setter
public class BudgetTypeVo {

    /**
     * 主键，追加时有值
     */
    private Long id;

    @Valid
    private List<TypeDetailVo> types;

    /**
     * 金额
     */
    @NotNull(message = "预算金额不能为空")
    @DecimalMin(value = "0", message = "预算金额不能为负数")
    @DecimalMax(value = "999999999.99", message = "预算金额超过上限")
    private BigDecimal amount;

    /**
     * 告警阀值
     */
    @NotNull(message = "预算告警阀值不能为空")
    @DecimalMin(value = "0", message = "预算告警阀值不能为负")
    @DecimalMax(value = "99.99", message = "预算告警阀值超过上限")
    private BigDecimal threshold;

    /**
     * 是否全部
     */
    private boolean ifAll;
}